package com.tlb.dto;


import java.text.SimpleDateFormat;
import java.util.Date;
import javax.persistence.*;


import java.util.*;
import com.tlb.web.*;


@Entity
public class FlaggedThread {

	
	
	@Transient
	private static SimpleDateFormat LAST_POST_FORMAT = new SimpleDateFormat("MM/dd/yyy");
	
    @Id
    private int threadId;
    private String title;
    private String flagName;

    
    @Temporal(TemporalType.TIMESTAMP)
    private Date flagDate;

    public int getThreadId() {
        return threadId;
    }

    public void setThreadId(int threadId) {
        this.threadId = threadId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getFlagName() {
        return flagName;
    }

    public void setFlagName(String flagName) {
        this.flagName = flagName;
    }

    public Date getFlagDate() {
        return flagDate;
    }

    public void setFlagDate(Date flagDate) {
        this.flagDate = flagDate;
    }
    

    public String getFlagDateString() {
        String retVal = null;
        try {
            retVal = LAST_POST_FORMAT.format(flagDate);
        } catch (Exception e) {
        }
        return retVal == null ? "UNKNOWN" : retVal;
    }    
    
    
    
    
}
